package com.blog.effective.note8;

/**
 * 〈windows操作系统的文件名〉<br>
 *
 * @author 未绪
 * @time 2017/12/17 9:18
 */
public class WindowsFileName {
    private String fileName;        //文件名称

    public WindowsFileName(String fileName) {
        this.fileName = fileName;
    }

    @Override
    public boolean equals(Object obj) {
        //如果穿传过来的是 WindowsFileName
        if(obj instanceof   WindowsFileName){
            return fileName.equalsIgnoreCase(((WindowsFileName) obj).fileName);
        }
        //如果穿过来的是文件名
        if(obj instanceof String){
            return fileName.equalsIgnoreCase((String)obj);
        }
        return false;
    }
}
